package com.shuyou.fragments;

import java.util.ArrayList;

import com.shuyou.R;
import com.shuyou.db.DBService;
import com.shuyou.net.SearchLabel;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class AllLabelFragment extends Fragment {

    private View rootView;
    
    private DBService dbService;
    
    private ArrayList<SearchLabel> list;
    
    private TextView tv;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        dbService = DBService.getInstance(getActivity());
        list = dbService.getSearchLabel();
        //需要判断一下list是否为空，list.isEmpty()
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.search_all_label, null);
        tv = (TextView)rootView.findViewById(R.id.textView1);
        tv.setText(list.toString());
        return rootView;
    }
}
